<include file="Public:head" />
<script src="__PUBLIC__/js/jquery/lazyload.js" type="text/javascript"></script>
<!--<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/perfect-scrollbar.min.css"/>
<script type="text/javascript" src="__PUBLIC__/js/perfect-mousewheel.min.js"></script>-->
<script>
    $(function() {
        $("img.lazy").lazyload({
            effect: "fadeIn"
        });
        $('#FoodTypeList').children("li").click(function() {
            $(this).addClass("active").siblings("li").removeClass("active");
            var index = $(this).index();
            if (index == 0) {
                $(".foodList").show();
            } else {
                $(".foodList").hide();
                $(".foodList").eq(index - 1).show();
            }
            $("img.lazy").lazyload({
                effect: "fadeIn"
            });
        })
        var word = "{$detail.business_time|getShopState=###,$detail['weeks'],$detail['is_busy']}";

        if (word) {
            $('.addToOrder').before("<span class=closed>" + word + "</span>");
            $('.addToOrder').remove();
            var state = "该餐厅已休息，这段时间无法提供外卖服务，看看其他餐厅吧！";
            if (word == '已打烊') {
                state = "餐厅已打烊，不用担心，已经成功下的订单均有效，<a  href={:U('Member/order')}>点击此处查看订单状态</a>";
            } else if (word == '太忙暂不送餐') {
                state = "该餐厅实在太忙，为了保证服务质量，暂时停止接受新订单。不用担心，已经成功下的订单均有效";

            } else if (word == '休息已放假') {
                state = "该餐厅已休假，这段时间无法提供外卖服务，看看其他餐厅吧！";
            }
        }
        if (state) {
            $(".attention").show();
            $('#shopState').html(state);
        }
    })
</script>
<div id="wrap">
    <!--end of header-->
    <div id="container" class="clearfix">
        <div id="attentionInfo" class="clearfix">
            <div class="attention br8 rest">
                <p id="shopState"></p>
            </div>

        </div>
        <div id="school">
            {$type=1|getAreaName}
            <a href="__APP__/?type=clean">[切换位置]</a> <span>/</span> 
            <em id="shop" data-url="{:U('Area/detail',array('id'=>$id))}">{$detail.name}</em>
        </div>
        <div class="clearfix">
            <div id="left" class="shadow s_menu">
                <div id="s_tab">
                    <a href="{:U('Area/detail',array('id'=>$id))}" class="active">看菜单</a>
                    <a href="{:U('Area/comments',array('id'=>$id))}">累积评价</a>
                    <a href="{:U('Area/messages',array('id'=>$id))}">给餐厅留言</a>
                </div>
                <div id="menuCategory" class="mt10">
                    <ul id="FoodTypeList" style="bottom:30px;" class="clearfix">
                        <li class="active"><a href="javascript:void(0)">全部类别</a></li>
                        <foreach name="cats" item="row">
                            <li><a href="javascript:void(0)">{$row.name}</a> </li>
                        </foreach>
                    </ul>
                </div>
                <div id="scrollPager">
                    <foreach name="cats" item="row">
                        <div class="foodList clearfix">
                            <h3 class="foodList_title">{$row.name}</h3>
                            <div class="foodListImg">
                                <table cellpadding="0" cellspacing="0"> 
                                    <foreach name="row['sub']" key="key" item="row2">
                                        <if condition="$row2.logo neq ''">
                                            <if condition="$key%3 eq 0">
                                                <tr>
                                            </if>
                                            <td class="foodListItem">
                                                <img src="__PUBLIC__/images/grey.gif" class="lazy" original="__APP__/{$Think.config.goodsFile}{$row2.logo}" width="190px" height="139px" alt="{$row2.name}" />
                                                <p class="foodTitle">{$row2.name}<span class="unit">(份)</span> {$row2.attr|getGoodsAttr=###}</p>
                                                <p class="food_remark">{$row2.intro}</p>
                                                <p class="price_outer">
                                                    <a class="addToOrder {$cartsIds|getCheckboxCla=###,$row2['id'],'active'}" id="btn_{$row2.id}" onclick="addToOrder($(this), '{$row2.id}')" data-name="{$row2.name}" data-price="{$row2['price']-$row2['discount']|getOneDot=###}" data-id="{$row2.id}"> </a>
                                            <if condition="$row2.discount gt 0"><del>{$row2.price}</del></if> 
                                            <span class="price">{$row2['price']-$row2['discount']|getOneDot=###}</span>元
                                            </p> 
                                            </td>
                                            <if condition="$key%3 eq 2">
                                                </tr>
                                            </if>
                                        </if>
                                    </foreach>
                                </table>
                            </div>

                            <foreach name="row['sub']"  item="row2">   
                                <if condition="$row2.logo eq ''">
                                    <div class="foodListItem">
                                        <ul class="foodListInfo">
                                            <li class="foodTitle">
                                                {$row2.name}<span>({$row2.unit|getStaticInfo=###=###,'dictionary','name'})</span>
                                                {$row2.attr|getGoodsAttr=###}
                                            </li>
                                            <li class="price_outer">
                                            <if condition="$row2.discount gt 0"><del>{$row2.price}</del></if> 
                                            <span class="foodPrice">{$row2['price']-$row2['discount']|getOneDot=###}</span>元
                                            </li>
                                            <li>
                                                <a class="addToOrder {$cartsIds|getCheckboxCla=###,$row2['id'],'active'}" id="btn_{$row2.id}" onclick="addToOrder($(this), '{$row2.id}')" data-name="{$row2.name}" data-price="{$row2['price']-$row2['discount']|getOneDot=###}" data-id="{$row2.id}"> </a>
                                            </li>
                                        </ul>
                                        <p class="description">{$row2.intro}</p>
                                    </div>
                                </if>
                            </foreach>   
                        </div>
                    </foreach>
                </div>
            </div>
            <include file="Public:right" />
        </div>
        <div class="to-top" style="display: block">
            <a href="#" title="回到顶部" class="top">回顶部</a> 
            <a href="__APP__/?type=clean" title="选择其它餐厅" class="back">选餐厅</a>
        </div>
    </div>
    <include file="Public:foot" />
   
    <!--Box:cart-->